package com.elinkway.infinitemovies.http.requesttask;

import android.content.Context;

import com.elinkway.infinitemovies.async.MoviesHttpAsyncTask;
import com.elinkway.infinitemovies.bean.ReportSubmitBean;
import com.elinkway.infinitemovies.config.SettingManage;
import com.elinkway.infinitemovies.http.api.MoviesHttpApi;
import com.elinkway.infinitemovies.http.parser.ReportSubmitParser;
import com.elinkway.infinitemovies.ui.activity.LoginActivity;
import com.lvideo.http.bean.LVideoDataHull;

/**
 * Created by zhaopeipei on 2016/5/1.
 */
public class uploadReportPictureTask extends MoviesHttpAsyncTask<ReportSubmitBean> {

    private String mPictureUtl;

    private String mAid;

    private String mContactPeople;

    private String mContactWay;

    private String mLawName;

    private Context mContext;

    @Override
    public void netNull() {
        super.netNull();
    }

    @Override
    public void netErr(int updateId, String errMsg) {
        super.netErr(updateId, errMsg);
    }

    @Override
    public void dataNull(int updateId, String errMsg) {
        super.dataNull(updateId, errMsg);
    }

    public uploadReportPictureTask(Context context,String pictureUrl, String aid, String contactPeople,
                                   String contactWay, String lawName) {
        super(context);
        mPictureUtl = pictureUrl;
        mAid = aid;
        mContactPeople = contactPeople;
        mContactWay = contactWay;
        mLawName = lawName;
        mContext = context;
    }

    @Override
    public LVideoDataHull<ReportSubmitBean> doInBackground() {
        LVideoDataHull<ReportSubmitBean> ret = MoviesHttpApi.postReportPicture(
                new ReportSubmitParser(), mPictureUtl, mAid,
                mContext.getSharedPreferences(SettingManage.LOGIN_INFO, Context.MODE_PRIVATE)
                        .getString(LoginActivity.UID, ""), mContactPeople, mContactWay, mLawName);
        if (ret.getDataType() == LVideoDataHull.DataType.DATA_IS_INTEGRITY) {
            ReportSubmitBean v = ret.getDataEntity();
        }
        return ret;
    }

    @Override
    public void onPostExecute(int updateId, ReportSubmitBean result) {
    }
}
